#ifndef _SQGAME_H_
#define _SQGAME_H_

#include "ResourceManager.h"
#include "InputManager.h"
#include "Renderer.h"
#include "Editor.h"

class Entity;
class Map;

class SQGame
{
friend class Editor;
public:
	static SQGame& getInstance(){return *instance;}
	bool init(int argc,char** argv,const SQChar* startUpScript);
	bool run(const SQChar* mainScript);
	void setEditMode(bool state);
	SQGame();
	~SQGame();

	void setCurrentMap(Map* map);
	Map* getCurrentMap() const {return currentMap;}

	void setDesiredFPS(unsigned int FPS);
	float getFrameTime() const;
	void end(){window.Close();}

	InputManager& getInputManager(){ return inputManager;}
	ResourceManager& getResourceManager(){ return resourceManager;}
	Renderer& getRenderer(){ return renderer;}
private:
	InputManager inputManager;
	ResourceManager resourceManager;
	Renderer renderer;
	sf::RenderWindow window;
	Editor editor;
	Map* currentMap;
	bool editMode;
	static SQGame* instance;
};

#endif